﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace RBACProject.Utlity
{
    /// <summary>
    /// MD5加密 辅助类
    /// </summary>
    public static class MD5Helper
    { 
        public static string Md5(this string input)
        {
            MD5 md5 = MD5.Create();
            byte[] sourceBytes = Encoding.UTF8.GetBytes(input);
            byte[] hashedBytes = md5.ComputeHash(sourceBytes);
            string hashedString = BitConverter.ToString(hashedBytes).Replace("-", "").ToLower();
            return hashedString;
        }
    }
}
